//
//  JGWithdrawalProgressCell.m
//  JGRider
//
//  Created by 单启志 on 2018/2/7.
//  Copyright © 2018年 ffq. All rights reserved.
//

#import "JGWithdrawalProgressCell.h"
@interface JGWithdrawalProgressCell()
@property (weak, nonatomic) IBOutlet UILabel *contentLab;
@property (weak, nonatomic) IBOutlet UILabel *datetimeLab;

@property (weak, nonatomic) IBOutlet UIView *roundView;
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *vLineConsTop;//竖线上端约束
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *roundViewConsW;

@end
@implementation JGWithdrawalProgressCell

- (void)awakeFromNib {
    [super awakeFromNib];
    self.selectionStyle=UITableViewCellSelectionStyleNone;
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

   
}

-(void)setModel:(JGWithdrawalProgressModel *)model{
    _model=model;
    self.contentLab.text=model.content;
    self.datetimeLab.text=model.datatime;
    [self setLayoutWith:model.isCurrent];
    if (model.isFirst) {
  self.vLineConsTop.constant=self.roundView.centerY;
    }else{
        self.vLineConsTop.constant=0;
    }

}

#pragma mark - private
-(void)setLayoutWith:(BOOL)isCurrent{
    if (isCurrent) {//当前状态
        //圆
        self.roundViewConsW.constant=AdaptedWidth(12) ;
        self.roundView.layer.cornerRadius=AdaptedWidth(12)/2;
        self.roundView.layer.masksToBounds=YES;
    self.roundView.backgroundColor=HEXCOLOR(0xfea129);
        self.roundView.layer.borderWidth=AdaptedWidth(2);
        self.roundView.layer.borderColor=RGB(255, 215, 156).CGColor;

        self.contentLab.textColor=HEXCOLOR(0xfea129);
        self.contentLab.font = [UIFont fontWithName:@ "Helvetica-Bold"  size:(14.0)];
        self.datetimeLab.textColor=HEXCOLOR(0xfea129);
    }else{
        //圆
    self.roundView.backgroundColor=HEXCOLOR(0xdbdbdb);
        self.roundViewConsW.constant=AdaptedWidth(8);
        self.roundView.layer.cornerRadius=AdaptedWidth(8)/2;
        self.roundView.layer.masksToBounds=YES;
        self.roundView.layer.borderWidth=0;

        self.contentLab.textColor=HEXCOLOR(0xb1b1b1);
        self.contentLab.font =[UIFont fontWithName:@"Helvetica" size:14.0]; //非加粗
        self.datetimeLab.textColor=HEXCOLOR(0x949494);
    }
}

-(void)layoutSubviews{
    [super layoutSubviews];



}

@end
